package com.ibeeking.found.upms.cp.rest.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ibeeking.found.common.entity.CurrentUser;
import com.ibeeking.found.common.entity.LoginUserDTO;
import com.ibeeking.found.common.entity.UserInfoDTO;
import com.ibeeking.found.upms.api.common.query.AccountLoginQuery;
import com.ibeeking.found.upms.service.common.bo.TenantUserBO;
import com.ibeeking.found.upms.service.common.dos.TenantUserDO;
import com.ibeeking.found.upms.service.common.param.TenantUserParam;
import com.ibeeking.found.upms.service.common.param.ModifyMobileParam;
import com.ibeeking.found.upms.service.common.param.UserFindPwdParam;
import com.ibeeking.found.upms.service.common.param.UserModifyPwdParam;
import com.ibeeking.found.upms.service.common.query.TenantUserPageQuery;
import com.ibeeking.found.upms.service.common.vo.CurrentCpUserVO;
import com.ibeeking.found.upms.service.common.vo.TenantUserVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author ibeeking
 */
public interface ICpUserService {

    /**
     * 客服分页
     *
     * @param query
     * @return
     */
    Page<TenantUserVO> pageList(TenantUserPageQuery query);

    /**
     * 获取租户logo
     *
     * @return
     */
    String queryTenantLogo();

    /**
     * 条件查询Cp用户
     * @return
     */
    TenantUserDO selectOneByQueryWrapper(LambdaQueryWrapper<TenantUserDO> queryWrapper);

    Boolean addTenantUser(Integer tenantId, TenantUserParam param);

    Boolean modifySelf(TenantUserParam param);

    TenantUserVO view(Long id);

    TenantUserBO queryById(Long id);

    List<TenantUserBO> queryLoginCpUserByMobileAndWxUserId(String wxUserId, String mobile);

    TenantUserBO queryByWxUserId(String wxUserId);

    TenantUserBO queryByDingUserId(String dingUserId);

    TenantUserBO queryByUserCode(String userCode);

    TenantUserBO queryByMobile(String mobile);

    TenantUserBO queryByUserCodeOrMobile(String mobile);

    Boolean modifyPwd(Long userId, UserModifyPwdParam userModifyPwdParam);

    Boolean modifyPassword(Long userId, String newPassword);

    Boolean findPwd(UserFindPwdParam userFindPwdParam);

    LoginUserDTO queryAccountLogin(AccountLoginQuery query);

    UserInfoDTO queryLoginUser(HttpServletRequest request, Long userId);

    Boolean modifyMobile(Long userId, ModifyMobileParam param);

    Boolean modifyWxUserId(String wxUserId, Long cpUserId);

    Boolean clearWxUserId(List<Long> ids);

    Boolean clearWxUserIdByWxUserId(String wxUserId);

    CurrentCpUserVO transferCurrentUser(CurrentUser currentUser);
}
